package top.infopub.dto.cap;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;
import top.infopub.enums.cap.FinancialTypesEnum;
import top.infopub.enums.cap.LoanStyleEnum;

import java.math.BigDecimal;
import java.util.Date;

public class FinReimDto {
    /** SGUID */
    private String id;

    /** 融资业务名称 */
    private String proName;

    /** 业务编号 */
    private String proCode;

    /** 融资团队负责人 */
    private String leader;

    /** 融资主体 */
    private String sgCoopId;

    /** 金融机构类型 */
    private String capType;

    /** 贷款类型 */
    private String loanType;

    /** 合同总金额 */
    private BigDecimal sumAmt;

    /** 还款金额 */
    private BigDecimal repayAmt;

    /** 实际还款金额 */
    private BigDecimal actRepayAmt;

    /** 实际还款日期 */
    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date actRepayDate;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getProName() {
        return proName;
    }

    public void setProName(String proName) {
        this.proName = proName;
    }

    public String getProCode() {
        return proCode;
    }

    public void setProCode(String proCode) {
        this.proCode = proCode;
    }

    public String getLeader() {
        return leader;
    }

    public void setLeader(String leader) {
        this.leader = leader;
    }

    public String getSgCoopId() {
        return sgCoopId;
    }

    public void setSgCoopId(String sgCoopId) {
        this.sgCoopId = sgCoopId;
    }

    public String getCapType() {
        return capType;
    }

    public void setCapType(String capType) {
        this.capType = capType;
        if (StringUtils.isNotBlank(capType)) {
            FinancialTypesEnum fte = FinancialTypesEnum.getByCode(capType);
            if (fte != null) {
                this.capType = fte.getName();
            }
        }
    }

    public String getLoanType() {
        return loanType;
    }

    public void setLoanType(String loanType) {
        this.loanType = loanType;
        if (StringUtils.isNotBlank(loanType)) {
            LoanStyleEnum lse = LoanStyleEnum.getByCode(loanType);
            if (lse != null) {
                this.loanType = lse.getName();
            }
        }
    }

    public BigDecimal getSumAmt() {
        return sumAmt;
    }

    public void setSumAmt(BigDecimal sumAmt) {
        this.sumAmt = sumAmt;
    }

    public BigDecimal getRepayAmt() {
        return repayAmt;
    }

    public void setRepayAmt(BigDecimal repayAmt) {
        this.repayAmt = repayAmt;
    }

    public BigDecimal getActRepayAmt() {
        return actRepayAmt;
    }

    public void setActRepayAmt(BigDecimal actRepayAmt) {
        this.actRepayAmt = actRepayAmt;
    }

    public Date getActRepayDate() {
        return actRepayDate;
    }

    public void setActRepayDate(Date actRepayDate) {
        this.actRepayDate = actRepayDate;
    }
}
